<?php
include("conToDB.php");

mysql_select_db($db, $con);

$sql = "SELECT p_namn FROM places ORDER BY p_namn";	
$result = mysql_query($sql);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>AddRate</title>
</head>

<body>
<form action="add_Rate.php">
	<table>
		<tr>
    		<td>Namn på restaurangen</td>
    	</tr>
    	<tr>
    		<td>
            	<select name="rnamn">
                	<option>Välj restaurangens namn</option>
                    <?php
						while($row = mysql_fetch_array($result))
						{
							echo "<option value='" . $row['p_namn'] . "'>" . $row['p_namn'] . "</option>";
						}
					?>
                </select>
        	</td>
    	</tr>
    	<tr>
    		<td>Betyg</td>
    	</tr>
        <tr>
        	<td>
            	<select name="rbetyg">
                	<option>Välj betyg</option>
                    <option value="1">1 - Dåligt</option>
                    <option value="2">2 - Blah!</option>
                    <option value="3">3 - Ok!</option>
                    <option value="4">4 - Värt ett återbesök</option>
                    <option value="5">5 - Besök!</option>
                </select>
            </td>
        </tr>
        <tr>
        	<td>Datum för besöket(YYYY-MM-DD)</td>
        </tr>
        <tr>
        	<td>
            	<input name="rdatum" type="date" />
            </td>
        </tr>
        <tr>
        	<td>Användarnamn:</td>
        </tr>
        <tr>
        	<td>
            	<input name="ruser" type="text" />
            </td>
        </tr>
        <tr>
        	<td>Kommentar om besöket</td>
        </tr>
        <tr>
        	<td><textarea name="rkommentar" cols="40" rows="4"></textarea></td>
        </tr>
        <tr>
        	<td>
            	<input type="submit" value="Spara besök" />
            	<button onclick="window.top.hidePopWin()">Stäng</button>
            </td>
        </tr>
	</table>
</form>
</body>
</html>
<?php
mysql_close($con);
?>